#! /bin/sh

MNTDIR=/mnt/hybrid-storage
CONF_FILE=/gwserver/sur.conf
MAX_RETRY=10

mount_hybrid_storage()
{  
    mkdir -pv $MNTDIR
    for i in `seq 1 $MAX_RETRY`
    do  
        umount $MNTDIR
        sur_mount config=$CONF_FILE $MNTDIR
        ls $MNTDIR
        if [ $? -eq 0 ]; then
            echo "Mount hybrid storage successfully"
            return 0
        fi
    done  

    echo "Failed to mount hybrid storage"
    umount $MNTDIR
    return 1
} 

mount_hybrid_storage
